import Model from './index';

import User from './user';
import Organization from './organization';
import Department from './department';

export default class Obj extends Model {
	
    format(row, isFromCache) {
		this.id = row.objID.toString();
        this.name = row.name;
        this.objId = row.objID;
        this.creatorId = row.creatorID;
        this.ownerId = row.ownerID;
        this.realObjId = row.realObjID;
        this.mountBandId = row.mountBandID;
        this.organizationId = row.organizationID;
        this.departmentId = row.departmentID;
        if(row.organization) {
            this.organization = new Organization(row.organization, isFromCache);
        }
        if(row.department) {
            this.department = new Department(row.department, isFromCache);
        }
        if(row.creator) {
            this.creator = new User(row.creator, isFromCache);
        }
    }
};
Obj.typeName = 'Obj';
Obj.displayName = '对象';